﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UMLDesigner
{
    class ClassData
    {
        private string name;
        private string modifier;
        private string visibility;
        private List<AttributeData> attributes;
        private List<MethodData> methods = new List<MethodData>();

        public ClassData()
        {
            attributes = new List<AttributeData>();
        }

        public string GetName()
        {
            return name;
        }

        public void SetName(string newName)
        {
            name = newName;
        }

        public string GetVisibility()
        {
            return visibility;
        }

        public void SetVisibility(string newVisibility)
        {
            visibility = newVisibility;
        }

        public string GetModifier()
        {
            return modifier;
        }

        public void SetModifier(string newModifier)
        {
            modifier = newModifier;
        }

        public List<AttributeData> GetAttributes()
        {
            return attributes;
        }

        public void SetAttributes(List<AttributeData> newAttributes)
        {
            attributes.Clear();
            for (int i = 0; i < newAttributes.Count; i++)
            {
                attributes.Add(newAttributes[i]);
            }
        }

        public List<MethodData> GetMethods()
        {
            return methods;
        }
        public void SetMethods(List<MethodData> newMethods)
        {
            methods.Clear();
            for (int i = 0; i < newMethods.Count; i++)
            {
                methods.Add(newMethods[i]);
            }
           
        }

        public void AddAttribute(string name, string type, string visibility)
        {
            AttributeData nuevoAtributo = new AttributeData(name, type, visibility);
            attributes.Add(nuevoAtributo);
        }
       /* public void QuitarAtributo(string atributo)
        {
            for (int i = 0; i < atributos.Count; i++)
            {
                
                if (atributos[i].GetRepresentacionUML() == atributo)
                {
                    atributos.Remove(atributos[i]);
                }
            }
        }*/
    }
}
